function muti(num) {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(num * num)
        }, 1000)
    })
}

const nums = [1, 2, 3]
nums.forEach(async i => {
    const res = await muti(i)
    console.log(res)
})
!(async function () {
    for (let val of nums){
        const res = await muti(val)
        console.log(res)
    }
})()